/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.reflection;

import java.lang.reflect.Field;

/**
 * <p>Project: javaseapp - Ref7
 * <p>Powered by webrx On 2021-08-30 17:42:12
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Ref7 {
    public static void main(String[] args) {
        Class u = User.class;
        Field n = null;
        try {
            n = u.getDeclaredField("name");
            System.out.println(n.getName());
            var un = n.getAnnotation(UserName.class);
            System.out.println(un.name());
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
        }

    }
}
